package file_temp

import (
	"fmt"
	"gopkg.in/yaml.v2"
)

var data = `
a: Easy!
b:
  c: 2
  d: [3, 4]
`

// Note: struct fields must be public in order for unmarshal to
// correctly populate the data.
type AA struct {
	RenamedC int   `yaml:"c"`
	D        []int `yaml:",flow"`
}

type T struct {
	A string
	B AA
}

func main() {
	t := T{
		A: "hello",
		B: AA{
			RenamedC: 1,
			D:        []int{1, 2},
		},
	}
	o, err := yaml.Marshal(t)
	if err != nil {
		fmt.Println(err)
	}
	fmt.Printf(string(o[:]))
}
